package visualcbir.decorators;

import imganalysis.DataUnit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import visualcbir.ModelComposed;
import visualcbir.PnlView;
import visualcbir.cluster.VSCircle;
import visualcbir.View;
import visualcbir.ViewComposed;
import visualcbir.node.ModelNode;
import visualcbir.node.ViewNode;

/**
 *
 * @author sheila
 */
public class FunHierarquical extends Functionality {     
    public FunHierarquical(View oView, PnlView poPnlView) {
        super(oView, poPnlView);
        this.oPnlView.addMouseListener( new  MouseAdapterFun());
    }

    @Override
    public void removeAll() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public class MouseAdapterFun extends MouseAdapter{
        public MouseAdapterFun(){
            super();
        }
//        @Override - 14 fev
//        public void mouseClicked(MouseEvent event) {
//            System.out.println("mouse clicked");
//             ViewNode nearestViewNode = ((ViewComposed)oView).findNode(event.getX(),event.getY());
//             int id = ((ModelNode)nearestViewNode.getModel()).getId();
//             System.out.println("o id es--------->"+id);
//
//             if( nearestViewNode != null && event.getClickCount()==2){
//                // guardar a vista anterior this.oView para fazer back
//
//                ModelComposed oModelClusters=new ModelComposed();
//                ArrayList<DataUnit> aDataUnits = ((ViewComposed)oView).findCluster(event.getX(),event.getY());
//                oModelClusters.getDataClusters(id,6,6,aDataUnits);
//
//                PnlView pnl=new PnlView(new VSCircle(oModelClusters,7));
//                oPnlView.changePnl(pnl);
//                oPnlView.repaint();
//                //oPnlView.setoView(new VSCircle(oModelClusters,7));
//                //oPnlView.repaint();
//                 System.out.println("*********************************aqui foi chamado");
//            }
//        }

        @Override
        public void mouseReleased(MouseEvent e) {
            System.out.println("FunHierarquical: exited");
            
        }
    }    

}
